﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using TomatoSynchronizer.Store;

namespace TomatoSynchronizer.Entities 
{

    public class XsellProduct 
    {

    	public override bool Equals(object obj)
		{
			if(obj is XsellProduct)
			{
				XsellProduct xsell = (XsellProduct)obj;
				
				//we only check if the products name are the same
				if(xsell._products_name == _products_name)
				{
					return true;
				}
			}
			
			return false;
		}
    	
        public XsellProduct()
        {
        }

        public XsellProduct(string json)
         : this(JObject.Parse(json))
        {
        }

        private JObject __jobject;
        public XsellProduct(JObject obj)
        {
            this.__jobject = obj;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }        

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _products_id;
        public string products_id
        {
            get
            {
                if(_products_id == null)
                    _products_id = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "products_id"));
                return _products_id;
            }
            set
            {
                _products_id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _products_name;
        public string products_name
        {
            get
            {
                if(_products_name == null)
                    _products_name = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "products_name"));
                return _products_name;
            }
            set
            {
                _products_name = value;
            }
        }

    }
}
